from flask import Flask
from flask import render_template
from flask import jsonify
import utils
import Get_Data
app = Flask(__name__)


@app.route('/')
def hello_world():
    return render_template("databoard.html")
@app.route('/time')
def get_time():
    return utils.get_time()
@app.route('/get_orcan')
def get_data():
    return jsonify({"name":Get_Data.ecchart7()[0],"data":Get_Data.ecchart7()[1]})
@app.route('/get_world_city')
def get_world_city():
    return jsonify({"confirm":Get_Data.ecchart4()[0],"dead":Get_Data.ecchart4()[1]})
@app.route('/get_county_heal')
def get_world_heal():
    return jsonify({"county":Get_Data.ecchart3()[0],"heal":Get_Data.ecchart3()[1]})
@app.route('/get_china')
def get_china():
    return jsonify(Get_Data.ecchart2())
@app.route('/get_worldmap')
def get_worldmap():
    return jsonify(Get_Data.ecchart_map())
@app.route('/get_china_city')
def get_china_city():
    return jsonify({"name":Get_Data.ecchart5()[0],"now":Get_Data.ecchart5()[1],"heal":Get_Data.ecchart5()[2],"dead":Get_Data.ecchart5()[3],"rate":Get_Data.ecchart5()[4]})
if __name__ == '__main__':
    app.run()
